import request from '@/utils/request'

// 创建专利信息
export function addPatentInfo(data?: any) {
  return request({
    url: '/project/patent-info/create',
    method: 'POST',
    data,
  })
}
// 获得专利信息分页
export function getPatentList(params?: any) {
  return request({
    url: '/project/patent-info/page',
    method: 'GET',
    params,
  })
}

// 获得专利信息
export function getPatentInfo(params?: any) {
  return request({
    url: '/project/patent-info/get',
    method: 'GET',
    params,
  })
}

// 删除专利信息
export const deletePatent = (id: number) => {
  return request({
    url: `/project/patent-info/delete?id=${id}`,
    method: 'DELETE',
  })
}
// 更新专利信息
export const updatePatent = (data: any) => {
  return request({
    url: '/project/patent-info/update',
    method: 'PUT',
    data,
  })
}

// 导出专利信息 Excel
export function getPatentExport(params: any) {
  return request({
    url: '/project/patent-info/export-excel',
    method: 'GET',
    responseType: 'blob',
    params,
  })
}

// 创建软著信息
export function addSoftware(data?: any) {
  return request({
    url: '/project/software-works-info/create',
    method: 'POST',
    data,
  })
}
// 获得软著信息分页
export function getSoftwareList(params?: any) {
  return request({
    url: '/project/software-works-info/page',
    method: 'GET',
    params,
  })
}

// 删除软著信息
export const deleteSoftware = (id: number) => {
  return request({
    url: `/project/software-works-info/delete?id=${id}`,
    method: 'DELETE',
  })
}
// 更新软著信息
export const updateSoftware = (data: any) => {
  return request({
    url: '/project/software-works-info/update',
    method: 'PUT',
    data,
  })
}

// 导出软著信息 Excel
export function getSoftwareExport(params: any) {
  return request({
    url: '/project/software-works-info/export-excel',
    method: 'GET',
    responseType: 'blob',
    params,
  })
}

// 获得软著信息
export function getSoftwareInfo(params?: any) {
  return request({
    url: '/project/software-works-info/get',
    method: 'GET',
    params,
  })
}
// 创建技术秘密信息
export function addTechnicalSecrets(data?: any) {
  return request({
    url: '/project/technology-secret-info/create',
    method: 'POST',
    data,
  })
}
// 获得技术秘密信息分页
export function getTechnicalList(params?: any) {
  return request({
    url: '/project/technology-secret-info/page',
    method: 'GET',
    params,
  })
}

// 删除技术秘密信息
export const deleteTechnical = (id: number) => {
  return request({
    url: `/project/technology-secret-info/delete?id=${id}`,
    method: 'DELETE',
  })
}
// 更新技术秘密信息
export const updateTechnical = (data: any) => {
  return request({
    url: '/project/technology-secret-info/update',
    method: 'PUT',
    data,
  })
}

// 导出技术秘密信息 Excel
export function getTechnicalExport(params: any) {
  return request({
    url: '/project/technology-secret-info/export-excel',
    method: 'GET',
    responseType: 'blob',
    params,
  })
}

// 获得技术秘密信息
export function getTechnicalInfo(params?: any) {
  return request({
    url: '/project/technology-secret-info/get',
    method: 'GET',
    params,
  })
}